import { getCartCount } from "@/network/cart"

const actions = {
    updateCart({commit, state}){
        getCartCount().then (res => {
            let count=0;
            console.log(res.data)
            if(res.data.nums__sum>0){
                count = res.data.nums__sum;
            }
            window.localStorage.setItem("count", count);
            commit("updateCartCount", {count: count})
        })
    }
}

export default actions;